<extend name="Layout/application"/>
<block name="content">
    <!-- content start -->
    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">标签</strong> /
                    <small>Course Tag</small>
                </div>
            </div>

            <hr>

            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-6">
                    <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                            <a type="button" class="am-btn am-btn-default" href="{{:url('create')}}"><span
                                    class="am-icon-plus"></span> 新增
                            </a>
                            <button type="button" class="am-btn am-btn-default"><span class="am-icon-trash-o"></span> 删除
                            </button>
                        </div>
                    </div>
                </div>
                <div class="am-u-sm-12 am-u-md-3">
                    <div class="am-form-group">
                        <select data-am-selected="{btnSize: 'sm'}">
                            <option value="option1">所有类别</option>
                            <option value="option2">IT业界</option>
                            <option value="option3">数码产品</option>
                            <option value="option3">笔记本电脑</option>
                            <option value="option3">平板电脑</option>
                            <option value="option3">只能手机</option>
                            <option value="option3">超极本</option>
                        </select>
                    </div>
                </div>
                <div class="am-u-sm-12 am-u-md-3">
                    <div class="am-input-group am-input-group-sm">
                        <input type="text" class="am-form-field">
                        <span class="am-input-group-btn">
            <button class="am-btn am-btn-default" type="button">搜索</button>
          </span>
                    </div>
                </div>
            </div>

            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main">
                            <thead>
                            <tr>
                                <th class="table-check"><input type="checkbox"/></th>
                                <th class="table-id">ID</th>
                                <th class="table-id">图片</th>
                                <th class="table-title">名称</th>
                                <th class="table-title">价格</th>
                                <th class="table-title">标签</th>
                                <th class="table-type">喜欢</th>
                                <th class="table-type">推荐</th>
                                <th class="table-type">发布</th>
                                <th class="table-type">完结</th>
                                <th class="table-type">日期</th>

                                <th class="table-set">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="courses" id="course">
                                <tr>
                                    <td><input type="checkbox"/></td>
                                    <td>{{$course.id}}</td>
                                    <td><a href="#">
                                        <img src="{{$course.photo.image}}" alt="" style="width: 50px;height: 50px">

                                    </a></td>
                                    <td>
                                        <a href="#">{{$course.name}} <span class="am-badge am-badge-primary am-round am-text-sm">{{:count($course.chapters)}}</span></a>
                                    </td>
                                    <td class="am-hide-sm-only">
                                        <span class="am-badge am-badge-primary am-radius am-text-sm">
                                        {{$course.price}}
                                        </span>
                                    </td>

                                    <td class="am-hide-sm-only ">
                                        <volist name="course.tags" id="tag">
                                        <span class="am-badge am-badge-success am-radius am-text-sm">

                                        {{$tag.name}}

                                            </span>
                                        </volist>
                                    </td>

                                    <td class="am-hide-sm-only"><span class="am-badge am-badge-warning am-round am-text-sm">{{$course.likes_count}}</span></td>
                                    <td class="am-hide-sm-only">
                                        <eq name="course.best" value="1">
                                            <span class=" am-badge am-badge-danger am-round">推荐</span>
                                            <else/>
                                            <span class=" am-badge am-badge-danger am-round "></span>
                                        </eq>
                                    </td>
                                    <td class="am-hide-sm-only">
                                        <eq name="course.publish" value="1">
                                            <span class=" am-badge am-badge-primary am-round">发布</span>
                                            <else/>
                                            <span class=" am-badge am-badge-danger am-round "></span>
                                        </eq>
                                    </td>
                                    <td class="am-hide-sm-only">
                                        <eq name="course.complete" value="1">
                                            <span class=" am-badge am-badge-primary am-round">更新中</span>
                                            <else/>
                                            <span class=" am-badge am-badge-danger am-round "></span>
                                        </eq>
                                    </td>
                                    <td class="am-hide-sm-only">{{$course.created_at}}</td>
                                    <td>
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <a class="am-btn am-btn-default am-btn-xs am-text-secondary"
                                                   href="{{:url('edit',['id'=>$course.id])}}"><span
                                                        class="am-icon-pencil-square-o"></span> 编辑
                                                </a>
                                                </button>
                                                <a class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"
                                                   href="{{:url('delete',['id'=>$course.id])}}">
                                                    <span class="am-icon-trash-o"></span> 删除
                                                </a>
                                                <a class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"
                                                   href="{{:url('admin/Chapters/index',['course_id'=>$course.id])}}">
                                                    <span class="am-icon-book">课程内容</span>
                                                </a>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                        <div class="am-cf">
                            共 15 条记录
                            <div class="am-fr">
                                <ul class="am-pagination">
                                    {{$courses|raw}}
                                </ul>
                            </div>
                        </div>
                        <hr/>
                        <p>注：.....</p>
                    </form>
                </div>

            </div>
        </div>

        <footer class="admin-content-footer">
            <hr>
            <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
        </footer>

    </div>
    <!-- content end -->

</block>

